package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.aop.AutoFill;
import com.zzyl.dto.NursingProjectPageQueryDto;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingPlanMapper {

    Page<NursingPlanVo> getNursingPlansByPage(NursingProjectPageQueryDto pageQueryDto);

    @AutoFill
    void add(NursingPlan plan);
    @AutoFill
    void update(NursingPlan plan);

    @Select("select * from nursing_plan where id = #{id}")
    NursingPlan read(Long id);

    @Select("delete from nursing_plan where id = #{id}")
    void delete(Long id);

    @Select("select * from nursing_plan where status=1")
    List<NursingPlan> findAll();
}
